﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Core.Infrastructure.ScreenManager
{
    public class ContentControlViewInjector : IViewInjector
    {
        Func<ContentControl> contentControlProvider;

        public ContentControlViewInjector(Func<ContentControl> contentControlProvider)
        {
            this.contentControlProvider = contentControlProvider;
        }

        public void InjectView(string regionName, Control view)
        {
            var contentControl = contentControlProvider();

            contentControl.Content = view;
        }

        public void RemoveAndDeactivateIfShould(string regionName, Control view)
        {
            var contentControl = contentControlProvider();

            contentControl.Content = null;
        }
    }
}
